﻿#ifndef INJECTORMANAGER_H
#define INJECTORMANAGER_H

#include "chart.h"
#include "serial_driver.h"
#include "setting.h"
#include "macro.h"

class InjectorManager : public QObject
{
    Q_OBJECT
public:
    InjectorManager(SerialDriver* port = nullptr);
    virtual ~InjectorManager();
    QList<Setting> getSetting();

    Injector injector[4];

private:
    Setting setting[4];
    bool apply_setting[4];
    SerialDriver* port;
    bool readData(const QByteArray& , int&);
    //QTimer m_timer[4];

public slots:
    void handlePort();
    //void handleTimeout();
    void updateSetting(QList<Setting>);

signals:
    void updateStatus();
    void sigUploadDataInj(const int, const Injector&);

};
// 0  1  2  3  4  5  6  7  8  9  10 11 12 13 14 15 16 17
//          FF 20 02 00 40 01 00 32 03 00 00 00 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00
#endif // INJECTORMANAGER_H
